<#import "/base/pageBase.ftl" as page>
<@page.pageBase currentMenu="首页">

<style type="text/css">
.imgsDiv{
	height:70px;line-height:70px;vertical-align: middle;font-size:43px;
}
.icontitlediv{  
height:70px;
} 
  
@media screen and (max-width:1550px) { 
.imgsDiv{ 
     font-size: 22px !important;   
    margin-left: 28px;  
    width: 60%;  
}
} 
</style>
<div class="wrapper wrapper-content">
<div class="row">  
            <div class="col-lg-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-success pull-right" style="background-color:#64ae3f;">种</span>
                        <h5>平台图书</h5>
                    </div> 
                    <div class="ibox-content">
                    	<div class="row">
                    		<div class="col-lg-3 icontitlediv">
		                    	<img src="${staticpath}/images/011.png"/>
		                    </div> 
		                    <div class="col-lg-9 imgsDiv">
		                    	<font id="totalBookNum"><image src='${basepath}/resource//images/loading7.gif'/></font>
		                    </div>
                    	</div>
                        
                    </div>  
                </div>
            </div>
            <div class="col-lg-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-info pull-right" style="background-color:#2f69ee">单</span>
                        <h5>今日订单</h5>
                    </div>
                    <div class="ibox-content">
                    	<div class="row">
                    		<div class="col-lg-3 icontitlediv">
		                    	<img src="${staticpath}/images/012.png"/>
		                    </div>
		                    <div class="col-lg-9 imgsDiv">
		                    	 <font id="ordernum"><image src='${basepath}/resource//images/loading7.gif'/></font>
		                    </div>
                    	</div>
                       
                    </div>
                </div>
            </div>
            <div class="col-lg-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-primary pull-right" style="background-color:#6865be">册</span>
                        <h5>今日图书</h5>
                    </div>
                    <div class="ibox-content">
                    	<div class="row">
                    		<div class="col-lg-3 icontitlediv">
		                    	<img src="${staticpath}/images/013.png"/>
		                    </div> 
		                    <div class="col-lg-9 imgsDiv">
		                    	 <font id="booknum"><image src='${basepath}/resource//images/loading7.gif'/></font>
		                    </div>
                    	</div>
                    </div> 
                </div>
            </div>
            <div class="col-lg-3">  
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-warning pull-right" style="background-color:#3a467a">￥</span>
                        <h5>余额</h5>   
                    </div>
                    <div class="ibox-content">
                    	<div class="row">
                    		
                    			<div class="col-lg-12 icontitlediv" style="display:none" id="multiBalanceDiv">
			                    	<div style="height: 40%;">
			                    		<img style="height: 30px;margin-top: -10px;" src="${staticpath}/images/014.png"/>
			                    		<font style= "font-size:20px" id="libBalance" class="libBalanceFont"></font>
			                    	</div>
			                    	<div id="multiBalance"style="height: 60%;border: 1px solid #e7eaec;font-size: 4pt;margin-top: 5px;text-align: center;">
			                    		
			                    	</div>
			                    </div> 
								<div id="normalBalanceDiv">
									<div class="col-lg-3 icontitlediv">
				                    	<img src="${staticpath}/images/014.png"/>
				                    </div> 
				                    <div class="col-lg-9 imgsDiv">
				                    	  <font id="libBalance" class="libBalanceFont"><image src='${basepath}/resource//images/loading7.gif'/></font>
				                    </div>
								</div>
                    			
                    		
                    	</div>
                        
                    </div>
                </div>    
			    </div> 
			</div> 
			
			
		<div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>近15天汇总</h5>
                        <div class="pull-right">
                        	<#if (manage_session_user_info.unitcode?? && manage_session_user_info.unitcode != '1212')>
	                            <div class="btn-group">
	                                <button type="button" class="btn btn-xs btn-white active btnTag" onclick="showview(0,this)">订单</button>
	                                <button type="button" class="btn btn-xs btn-white btnTag" onclick="showview(1,this)">图书</button>
	                                <button type="button" class="btn btn-xs btn-white btnTag" onclick="showview(2,this)">金额</button>
	                            </div>
	                        </#if>
                        </div>
                    </div> 
                    <div class="ibox-content">
                        <div class="row">
                        <div class="col-lg-9">
                            <div class="flot-chart">
                                <div class="flot-chart-content" id="flot-dashboard-chart">
                                	
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-3">
                            <ul class="stat-list" id="stateDiffView">
                                <image src="${basepath}/resource//images/loading7.gif"/>
	                        </ul>
	                    </div>
	                </div>
                </div>		
            </div>
        </div>
	</div>
    
    
        <div class="row">
            <div class="col-lg-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                    	<div id="titleDiv" style="float:left;width:70%">
                    		
                    		<h5 id="keyTitle"><#if manage_session_user_info.unitcode == '999'>订单排行榜<#else>热门检索</#if></h5>
                    		
                    	</div>
                       
                        <div class="ibox-tools" style="width: 20%;float: right;">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                    	<#if manage_session_user_info.unitcode != '999'>
                    		<select id="describeSelect" onChange="changeDescribe()" style="opacity: 0;visibility: hidden;width:40%" class="input-sm form-control input-s-sm inline">                  	
                    	</#if>
                    			
                		</select>
                    	<div style="overflow-x: auto; overflow-y: auto; height: 300px;" id="hotwordTable">
	                		<table class="table table-hover no-margins">
	                			<#if manage_session_user_info.unitcode == '999'>
	                				 <thead>
	              						<th>图书馆</th>
	              						<th>订单数</th>
	              					<thead>
	                			</#if>	                           
	                            <tbody id="hotWordBody">
		                           
	                            
	                            </tbody>
	                        </table>
	                        
                    	</div>
                    	
                    	<div class="row" id="loanrateDiv"style="height:270px;display:none">
                    		
                    		<div class="col-md-12" >
                    			<div  id="loanrateBar"  style="min-width: 110px; height: 270px; margin: 0 auto">
                    			
                    			</div>
                    		</div>
                    		
                    	</div>                      
                    </div>
                </div>
            </div>
            <div class="col-lg-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>
                        	<#if manage_session_user_info.unitcode == '999'>
                        		京东余额|差额：
                        		<#list sumPricedifferences? keys as key>
                        			[${key!}]${sumPricedifferences[key]!""}|<span id="${key!""}"></span>
                        		</#list>
                        	<#else>
                        		馆内借阅
                        	</#if>
                        </h5>
                        <div class="ibox-tools"> 
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i> 
                            </a>
                            <a class="close-link">    
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                      	<div class="float-chart">
                      		<#if manage_session_user_info.unitcode == '999'>
                      			<div id="pieChart" style="overflow-x: auto; overflow-y: auto; height: 300px;">
                      				<table class="table table-hover no-margins" >
                      					<thead>
                      						<th>图书馆</th>
                      						<th>余额</th>
                      					<thead>
                      					<tbody>
                      						<#if balanceList?? && balanceList?size gt 0>
		                      					<#assign libMap=systemSetting().libcodeMap>
							                       <#list balanceList as item>
							                      		<#if item.unitcode=="1039">
							                       		<#else>
								                      	 <tr>
							                       			 <#if libMap[item.unitcode!""]??>
							                       			 <td>${libMap[item.unitcode!].libname!""}</td>
							                       			 <td>${item.balance!"0.00"}元</td>
							                       			</#if> 
								                         </tr> 
							                       		</#if>
							                       </#list>
		                      				</#if>
                      					</tbody>
                      				</table>
                      			</div>
                      		<#else>
                      			<div id="pieChart" style="width:100%;height:300px">
                      		
                      			</div>	
                      		</#if>
                      		
                      	</div>
                    </div> 
                </div>
            </div>
        </div>
        <#if manage_session_user_info.unitcode == '999'>
	        <div class="row">
	        	 <div class="col-lg-6">
	                <div class="ibox float-e-margins">
	                    <div class="ibox-title">
	                        <h5>
	                        	余额
	                        </h5>
	                        <div class="ibox-tools"> 
	                            <a class="collapse-link">
	                                <i class="fa fa-chevron-up"></i> 
	                            </a>
	                            <a class="close-link">    
	                                <i class="fa fa-times"></i>
	                            </a>
	                        </div>
	                    </div>
	                    <div class="ibox-content">
	                      	<div class="float-chart">
                      			<div style="overflow-x: auto; overflow-y: auto; height: 300px;">
                      				<table class="table table-hover no-margins" >
                      					<thead>
                      						<th>京东key</th>
                      						<th>余额</th>
                      					<thead>
                      					<tbody id="balanceTable">
                      						
                      					</tbody>
                      				</table>
                      			</div>	                      		
	                      	</div>
	                    </div> 
	                </div>
	            </div>
	        </div>
        </#if>
    </div> 
    <script type="text/javascript" src="${staticpath}/js/highcharts/echarts.simple.min.js"></script>
    <script type="text/javascript" src="${staticpath}/js/WebSocketUtils.js"></script>
    <script type="text/javascript">
    	
    	$(function(){
    		baseCountData();
    		showview("0");
    		diffCountView();
    		<#if manage_session_user_info.unitcode == '999'>
    			countOrderNumByLib();
    			jdSumDiff();
    		<#else>
    			borrowPieView();
    			loanratePieView('');
    		</#if>
    		<#if manage_session_user_info.recieverNewOrderNotifyFlag?? && manage_session_user_info.recieverNewOrderNotifyFlag==1>   		
				var timer = setInterval("checkNewOrderNotify()",60000);   
    		</#if>
    	})
    	
		var dom = document.getElementById("flot-dashboard-chart");
		var drillDown = {
		    getOption : function () {
	        	var option = null;
            	option = {	
                   tooltip : {
				        trigger: 'axis',
				        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
				            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
				        }
				    },
				    grid: {
				        left: '3%',
				        right: '4%',
				        bottom: '3%',
				        containLabel: true
				    },
				    xAxis : [
				        {
				            type : 'category',
				            data : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
				            axisTick: {
				                alignWithLabel: true
				            }
				        }
				    ],
				    yAxis : [
				        {
				            type : 'value'
				        }
				    ],
				   
				    series : [
				        {
				            name:'直接访问',
				            type:'bar',
				            data:[10, 52, 200, 334, 390, 330, 220],	
				            itemStyle: {
								normal: {
									color: function(params) {
				                        // build a color map as your need.
				                        var colorList = [
				                         '#19CAAD','#D6D5B7','#8CC7B5','#D1BA74','#E6CEAC','#A0EEE1','#ECAD9E','#BEE7E9','#F4606C'
									     ,'#BEEDC7','#FC6E51','#4FC1E9','#AC92EC'
									     ,'#5D9CEC','#EC87C0','#656D78','#E9573F' 
									     ,'#8CC152','#3BAFDA','#967ADC','#D770AD'
				                        ];  
				                        return colorList[params.dataIndex]
				                    },
									label: {
										show: true,  
										position: 'top',
										formatter: '{c}'
									}
								}
							}			            
				        }
				    ]
                };
                return option;
		    },
		    initChart : function (data) {
		        echarts.dispose(dom);
		        // 初始化一个新的实例
		        var myChart = echarts.init(dom);
		        //console.log(myChart);
	            var option = drillDown.getOption();
	           // console.log(option);
		        option.xAxis[0].data =  JSON.parse(data.xarray);
		        option.series[0].data = JSON.parse(data.yarray);
		        option.series[0].name= data.yname;
		        myChart.setOption(option, true);
		  }
		}
		
		
		//饼图
		var pieDom = document.getElementById("pieChart");
		var pieDrillDown = {
		    getOption : function () {
	        	var option = null;
            	option = {	
                    title : {
				        text: '馆内借阅',
				        x:'center'
				    },
				    tooltip : {
				        trigger: 'item',
				        formatter: "{a} <br/>{b} : {c} ({d}%)"
				    },
				    color:['#19CAAD','#D6D5B7','#8CC7B5','#D1BA74','#E6CEAC','#A0EEE1','#ECAD9E','#BEE7E9','#F4606C'
				     ,'#BEEDC7','#FC6E51','#4FC1E9','#AC92EC'
				     ,'#5D9CEC','#EC87C0','#656D78','#E9573F' 
				     ,'#8CC152','#3BAFDA','#967ADC','#D770AD'], 
				    legend: {
				        orient: 'vertical',
				        left: 'left',
				        data: ['昨日下单册数','昨日馆内流通数']
				    },
				    label: {
		                normal: {
		                    show: true,
		                    formatter: '{b}: {c}({d}%)'
		                }
		            },
				    series : [
				        {
				            name: '馆内借阅',
				            type: 'pie',
				            radius : '55%',
				            center: ['50%', '60%'],
				            data:[
				            ],
				            itemStyle: {
				                emphasis: {
				                    shadowBlur: 10,
				                    shadowOffsetX: 0,
				                    shadowColor: 'rgba(0, 0, 0, 0.5)'
				                }
				            }
				        }
				    ]
                };
                return option;
		    },
		    initChart : function (data) {
		    	//console.log(data.dataArray);
		        echarts.dispose(pieDom);
		        // 初始化一个新的实例
		        var myChart = echarts.init(pieDom);
	            var option = pieDrillDown.getOption();
		        option.series[0].data = JSON.parse(data.dataArray);
		        myChart.setOption(option, true);
		   }
		}
		

		function showview(type,btn){
			$("#flot-dashboard-chart").html('<image src="${basepath}/resource//images/loading7.gif"/>');
			$.ajax({
				url:"${basepath}/manage/chart/countSomeDatabyDate",
				type:"post",
				dataType:"json",
				data:{type:type},
				success:function(data){
					$("#flot-dashboard-chart").html("");			
					if(data && data.code==0){
						$(".btnTag").removeClass("active");
						$(btn).addClass("active");						
			            drillDown.initChart(data.result);
					}
				},error:function(){
					$("#flot-dashboard-chart").html("");	
					console.log("请求异常");
				}
			});
			
		
		}
    	function baseCountData(){
    		$.ajax({
    			url:"${basepath}/manage/chart/countBaseDate",
    			type:"POST",
    			dataType:"json",
    			success:function(data){
    				if(!isEmpty(data)){
    					$("#totalBookNum").html(data.totalBookNum);
    					$("#ordernum").html(data.ordernum);
    					$("#booknum").html(data.booknum);
    					<#if !(manage_session_user_info.unitcode == '999')>
    						$(".libBalanceFont").html(data.libBalance);
    					</#if>
    					
    					//大于1条才显示，只有一条，按原来样子
    					if(data.balanceList && data.balanceList.length > 1){
    						var obj = data.balanceList;
    						var result = "";
    						var width="50%";
    						var size = data.balanceList.length
    						if(data.balanceList.length >2){
    							width = "33%";
    							size = 3;
    						}
    						for(var i=0;i<size;i++){
    							result+="<div style='float:left;height:100%;width:"+width+";";
			                    if(i>0){	
			                    	result+="border-left:1px solid  #e7eaec;";
			                    }
			                    result+="'>"
			                    	+"<div style='margin: 0 auto;font-size: 13px;position: relative;top: 50%;transform: translateY(-50%);'><div>"
			                    	+obj[i].balance		
	                    			+"</div>"
			                    	+"<div>"
			                    	+obj[i].seller
	                    			+"</div></div>"
		                    		+"</div>";
    						}
    						$("#multiBalance").html(result);
    						$("#normalBalanceDiv").hide();
    						$("#multiBalanceDiv").show();
    					}
    					
    				}else{
    					$("#totalBookNum").html(0);
    					$("#ordernum").html(0);
    					$("#booknum").html(0);
    					<#if !(manage_session_user_info.unitcode == '999')>
    						$("#libBalance").html(0);
    					</#if>
    					
    				}
    				
    			},error:function(){
    				console.log("请求异常");
    			}	
    		})
    	}
    	
    	function diffCountView(){
    		$.ajax({
    			url:"${basepath}/manage/chart/diffCountView",
    			type:"POST",
    			dataType:"json",
    			success:function(data){
    				//console.log(data);
    				$("#stateDiffView").html(""); 
    				if(!isEmpty(data)){
    					$.each(data,function(key,value){ 
    						    
							var result="";
							var str = "今日新增读者同比";
							if("newAccount"==key){
								str = "今日新增读者同比";
							}else if("activeAccount"==key){
								str = "今日活跃读者同比";
							}else if("pageView"==key){
								str = "今日访问量同比";
							}
							var tag = "fa-level-up";
							if(value.diff == "1"){
								tag = "fa-level-down";
							}
							result+='<li>'
	                            +'<h2 class="no-margins">'+value.now+'</h2>'
	                            +'<small>'+str+'</small>'
	                            +'<div class="stat-percent">'+value.before+' <i class="fa '+tag+' text-navy"></i></div>'
	                            +'<div class="progress progress-mini">'
                                +'<div style="width: '+value.percent+'%;" class="progress-bar"></div>'
			                    +'</div>'
					         	+'</li>';
					        $("#stateDiffView").append(result);    
						}); 
    				}
    			},error:function(){
    				$("#stateDiffView").html(""); 
    				console.log("请求异常");
    			}	
    		})
    	}
    	
    	function borrowPieView(){
			//$("#pieChart").html('<image src="${basepath}/resource/images/loading7.gif"/>');
			$.ajax({
				url:"${basepath}/manage/chart/borrowPieView",
				type:"post",
				dataType:"json",
				success:function(data){
					//console.log(data)
					//$("#pieChart").html("");			
					if(data && data.code==0){					
			            pieDrillDown.initChart(data.result);
					}
				},error:function(){
					//$("#pieChart").html("");	
					console.log("请求异常");
				}
			});
		}
		function hotSearchWord(){
			$.ajax({
				url:"${basepath}/manage/chart/getHotSearchWord",
				type:"post",
				dataType:"json",
				success:function(data){
					if(data && data.length >0){
						var result = "";
						for(var i=0;i<data.length;i++){
							 
						 	 result+='<tr>'
	                            +'<td>'+data[i]+'</td>'
	                       		+'</tr>';
							 
						}
						$("#hotWordBody").append(result);
					}
				},error:function(){
					//$("#pieChart").html("");	
					console.log("请求异常");
				}
			});
		}		
		function countOrderNumByLib(){
			$.ajax({
				url:"${basepath}/manage/chart/countOrderNumByLib",
				type:"post",
				dataType:"json",
				success:function(data){
					console.log(data);
					if(data && data.length >0){
						var result = "";
						for(var i=0;i<data.length;i++){
						 	 result+='<tr>'
                                +'<td>'+data[i].value+'</td>'
                                +'<td>'+data[i].count+'</td>'
                           		+'</tr>';
						}
						$("#hotWordBody").append(result);
					}
				},error:function(){
					//$("#pieChart").html("");	
					console.log("请求异常");
				}
			});
		}
		function jdSumDiff(){
			
			<#if sumJDBalance??>
				<#list sumJDBalance?keys as key>
					var htmlStr = '已下订单<b>{0}</b>单，图书<b>{1}</b>册。<br/>' + 
							'资金方面，单位剩余资金<b>{2}</b>元，已购书<b>{3}</b>元，运费<b>{4}</b>元。';
					var _url = "getUnitBill";
					$.ajax({
					  type: 'POST',
					  url: _url,
					  data:{jdAccount:'${key!""}'},
					  dataType: "json",
					  success: function(data){
					  	if(data.orderCount){
					  		var html = htmlStr.replace("{0}", data.orderCount) // 下到京东的订单
										  		.replace("{1}", data.bookCount)	// 下到京东的订单包含的图书总册
										  		.replace("{2}", data.balance)		// 余额
										  		.replace("{3}", data.amount)			// 金额
										  		.replace("{4}", data.fee);		// 运费
					  		//计算差额
					  		var sumJDBalance="${sumJDBalance[key]!""}";
					  		var tableTr="<tr>"
					  					+"<td>${key!}</td>"
					  					+"<td>"+data.balance.substring(0,data.balance.length-4)+"</td>";
							                       			
					  		$("#balanceTable").append(tableTr);
					  		<#if key?? && key=="TCJDKEY">
					  			$(".libBalanceFont").html(data.balance.substring(0,data.balance.length-4));
					  		</#if>
					  		
					  		if(sumJDBalance!=""){
					  			var difference=parseFloat(data.balance)-parseFloat(sumJDBalance);
					  			$("#${key!""}").text(difference.toFixed(2)+"元");
					  		}
					  	}else{
					  		
					  	}
					  },
					  error:function(er){
			    		 
					  }
					});
				</#list>
			</#if>
			
			// 帐单信息。
			
		}
		
		var bar1 = document.getElementById("loanrateBar");
		var loanrateBarDrillDown = {
		    getOption : function () {
	        	var option = null;
            	option = {	
                   tooltip : {
				        trigger: 'axis',
				        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
				            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
				        },
				        formatter: '{b} : {c}%'
				    },
				    grid: {
				        left: '3%',
				        right: '4%',
				        bottom: '3%',
				        containLabel: true
				    },
				    xAxis : [
				        {
				            type : 'category',
				            data : ['云书馆采访','传统馆内采访'], 
				            axisTick: {
				                alignWithLabel: true
				            }
				        }
				    ],
				    yAxis : [
				        {
				            type : 'value'
				        }
				    ],
				   
				    series : [
				        {
				            name:'复借率',
				            type:'bar',
				            barWidth:60,
				            data:[10, 52, 200, 334, 390, 330, 220],	
				            itemStyle: {
								normal: {
									color: function(params) {
				                        // build a color map as your need.
				                        var colorList = [
				                         '#19CAAD','#D6D5B7','#8CC7B5','#D1BA74','#E6CEAC','#A0EEE1','#ECAD9E','#BEE7E9','#F4606C'
									     ,'#BEEDC7','#FC6E51','#4FC1E9','#AC92EC'
									     ,'#5D9CEC','#EC87C0','#656D78','#E9573F' 
									     ,'#8CC152','#3BAFDA','#967ADC','#D770AD'
				                        ];  
				                        return colorList[params.dataIndex]
				                    },
									label: {
										show: true,  
										position: 'top',
										formatter: '{c}%'
									}
								}
							}			            
				        }
				    ]
                };
                return option;
		    },
		    initChart : function (data) {
		        echarts.dispose(bar1);
		        // 初始化一个新的实例
		        var myChart = echarts.init(bar1);
		        //console.log(myChart);
	            var option = loanrateBarDrillDown.getOption();
	           // console.log(option);
		        option.series[0].data = data;
		        myChart.setOption(option, true);
		  }
		}
		function loanratePieView(describe){
			//$("#pieChart").html('<image src="${basepath}/resource/images/loading7.gif"/>');
			$.ajax({
				url:"${basepath}/manage/chart/getHotSearchWord",
				type:"post",
				data:{description:describe},
				dataType:"json",
				success:function(data){
					//console.log(data)
					//$("#pieChart").html("");			
					if(data && data.code==0){
						//console.log(data.hotSearchWord);
						if(data.result && data.result.hasOwnProperty("allLoanrate") ){
							$("#hotwordTable").hide();
							$("#loanrateDiv").show();
							$("#keyTitle").html("馆藏复借率");
							//填充describe							
							var result = "";
							var size = data.result.allLoanrate.length;
							if(size > 1){
								for(var i=0;i<data.result.allLoanrate.length;i++){
									var obj = data.result.allLoanrate[i];
									result+='<option value="'+obj.description+'">'+obj.description+'</option>';
								}
								$("#describeSelect").html(result);
								$("#describeSelect").css("visibility","");
								$("#describeSelect").css("opacity","");	
							}
													
							//饼图
							//loanratePieDrillDown.initChart(data.result);
							//柱状图
							loanrateBarDrillDown.initChart(data.result.barLoanrate);		
						
						}else{
							
							var result = "";
							if(data.result.hotSearchWord && data.result.hotSearchWord.length>0){
								for(var i=0;i<data.result.hotSearchWord.length;i++){
									 var obj = data.result.hotSearchWord[i];
								 	 result+='<tr>'
			                            +'<td>'+obj+'</td>'
			                       		+'</tr>';
									 
								}
							}
							$("#describeSelect").remove();
							$("#hotWordBody").append(result);
						}
									
					}
				},error:function(){
					//$("#pieChart").html("");	
					console.log("请求异常");
				}
			});
		}
		
		function changeDescribe(){
			var value = $("#describeSelect").val();
			loanratePieView(value);
		}
    </script>    
</@page.pageBase>